home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / libraries / mui20dev.lha / MUI / Developer / Autodocs / MUI_Application.doc next >
Text File  |  1994-02-11  |  31KB  |  1,050 lines

  1. TABLE OF CONTENTS
  2.  
  3. Application.mui/Application.mui
  4. Application.mui/MUIM_Application_GetMenuCheck
  5. Application.mui/MUIM_Application_GetMenuState
  6. Application.mui/MUIM_Application_Input
  7. Application.mui/MUIM_Application_InputBuffered
  8. Application.mui/MUIM_Application_Load
  9. Application.mui/MUIM_Application_PushMethod
  10. Application.mui/MUIM_Application_ReturnID
  11. Application.mui/MUIM_Application_Save
  12. Application.mui/MUIM_Application_SetMenuCheck
  13. Application.mui/MUIM_Application_SetMenuState
  14. Application.mui/MUIM_Application_ShowHelp
  15. Application.mui/MUIA_Application_Active
  16. Application.mui/MUIA_Application_Author
  17. Application.mui/MUIA_Application_Base
  18. Application.mui/MUIA_Application_Broker
  19. Application.mui/MUIA_Application_BrokerHook
  20. Application.mui/MUIA_Application_BrokerPort
  21. Application.mui/MUIA_Application_BrokerPri
  22. Application.mui/MUIA_Application_Commands
  23. Application.mui/MUIA_Application_Copyright
  24. Application.mui/MUIA_Application_Description
  25. Application.mui/MUIA_Application_DiskObject
  26. Application.mui/MUIA_Application_DoubleStart
  27. Application.mui/MUIA_Application_DropObject
  28. Application.mui/MUIA_Application_Iconified
  29. Application.mui/MUIA_Application_Menu
  30. Application.mui/MUIA_Application_MenuAction
  31. Application.mui/MUIA_Application_MenuHelp
  32. Application.mui/MUIA_Application_RexxHook
  33. Application.mui/MUIA_Application_RexxMsg
  34. Application.mui/MUIA_Application_RexxString
  35. Application.mui/MUIA_Application_SingleTask
  36. Application.mui/MUIA_Application_Sleep
  37. Application.mui/MUIA_Application_Title
  38. Application.mui/MUIA_Application_Version
  39. Application.mui/MUIA_Application_Window
  40. Application.mui/Application.mui
  41.  
  42. Application class is the master class for all
  43. MUI applications. It serves as a kind of anchor
  44. for all input, either coming from the user or
  45. somewhere from the system, e.g. commodities
  46. or ARexx messages.
  47.  
  48. An application can have any number of sub windows,
  49. these windows are the children of the application.
  50. Application.mui/MUIM_Application_GetMenuCheck
  51.  
  52.     NAME
  53.     MUIM_Application_GetMenuCheck
  54.  
  55.     SYNOPSIS
  56.     DoMethod(obj,MUIM_Application_GetMenuCheck,ULONG MenuID);
  57.  
  58.     FUNCTION
  59.     Ask whether a checkmark menu item has its checkmark
  60.     set or cleared.
  61.     The application will ask its sub windows for a
  62.     menu item with the given id and return the state of
  63.     the first item it finds.
  64.  
  65.     INPUTS
  66.     MenuID - the value you wrote into the
  67.                  UserData field of struct NewMenu.
  68.  
  69.     SEE ALSO
  70.     MUIM_Application_SetMenuCheck, MUIA_Application_Menu
  71. Application.mui/MUIM_Application_GetMenuState
  72.  
  73.     NAME
  74.     MUIM_Application_GetMenuState
  75.  
  76.     SYNOPSIS
  77.     DoMethod(obj,MUIM_Application_GetMenuState,ULONG MenuID);
  78.  
  79.     FUNCTION
  80.     Ask whether a menu item is enabled or disabled.
  81.     The application will ask its sub windows for a
  82.     menu item with the given id and return the state of
  83.     the first item it finds.
  84.  
  85.     INPUTS
  86.     MenuID - the value you wrote into the
  87.                  UserData field of struct NewMenu.
  88.  
  89.     SEE ALSO
  90.     MUIM_Application_SetMenuState, MUIA_Application_Menu
  91. Application.mui/MUIM_Application_Input
  92.  
  93.     NAME
  94.     MUIM_Application_Input
  95.  
  96.     SYNOPSIS
  97.     DoMethod(obj,MUIM_Application_Input,LONGBITS *signal);
  98.  
  99.     FUNCTION
  100.     The MUI system itself does not wait for any user input.
  101.     It just tells your application which signal bits it
  102.     has allocated, then it's up to you to call MUIs input
  103.     handle function when one of these signals gets set.
  104.  
  105.     In a simple MUI application you would just Wait()
  106.     for these signals and call MUI when one is received.
  107.     However, you can perfectly allocate some signal bits
  108.     yourself and include them in your Wait() command.
  109.     You needn't even Wait(), your application could
  110.     maybe calculate some fractal graphics or copy
  111.     disks, the only important thing is that you call
  112.     MUI's input method when one of the MUI allocated
  113.     signals arrives.
  114.  
  115.     The usual way of communication with your user
  116.     interface is via return ids. Every action happening
  117.     to the GUI can create return ids, e.g. pressing a
  118.     button or trying to close a window. MUI buffers these
  119.     ids and uses them as result codes for the input method.
  120.     Thats where you can get it from and take the appropriate
  121.     actions.
  122.  
  123.     Now lets have a look on a usual input loop of a
  124.     MUI application. Imagine you have an Play and a
  125.     Cancel button and have previously told them
  126.     to return ID_PLAY and ID_CANCEL when pressed.
  127.     (see MUIM_Notify and MUIM_Application_ReturnID
  128.     on information about these topics). Your input
  129.     loop would look like this:
  130.  
  131.  
  132.     while (running)
  133.     {
  134.        ULONG signals;
  135.  
  136.        switch (DoMethod(app,MUIM_Application_Input,&signals))
  137.        {
  138.           case ID_PLAY:
  139.              PlaySound();
  140.              break;
  141.  
  142.           case ID_CANCEL:
  143.           case MUIV_Application_ReturnID_Quit:
  144.              running = FALSE;
  145.              break;
  146.        }
  147.  
  148.        if (running && signals) Wait(signals);
  149.     }
  150.  
  151.  
  152.     So what is happening here?
  153.  
  154.     First, you have to call the MUIM_Application_Input method.
  155.     You supply the address of a ULONG as parameter, thats
  156.     where MUI fills in the signals it needs. Note that you can
  157.     call the input method at any time, regardless of signal
  158.     setting. MUI will simply return when there is nothing
  159.     to do.
  160.  
  161.     In case the user pressed the Play or the Cancel button,
  162.     MUIM_Application_Input will return ID_PLAY or ID_CANCEL.
  163.     Otherwise you will receive a 0, that's why you cannot
  164.     use 0 as one of your id values.
  165.  
  166.     There is one predefined id called
  167.     MUIV_Application_ReturnID_Quit. This will be sent to you
  168.     when someone tried to quit your application from outside,
  169.     e.g. via commodities exchange or the ARexx "quit" command.
  170.     It is required that your application handles this id,
  171.     just treat as if the user clicked on a "Quit" button or
  172.     selected a "Quit" menu item.
  173.  
  174.     After handling the return value, you have to examine
  175.     if MUI wants you to wait for any signals. If this
  176.     is the case (signals != 0), just wait for it. If
  177.     MUI puts a 0 into signals it wants to tell you to
  178.     immediately call the input method again, maybe some
  179.     other return ids have received and need to be handled.
  180.     You *must* check this because Wait()ing on a zero
  181.     signal mask is not a good idea!
  182.  
  183.     Note: It is very important that you call the input method
  184.     whenever a signal arrives. MUI needs this to correctly
  185.     refresh its windows, handle resizing and iconification
  186.     operations and commodities and ARexx messages. If you
  187.     don't, you will annoy your user!
  188.  
  189.     If your program needs to be in a state where you are
  190.     for some reasons unable to call the input method for
  191.     a considerable amount of time (maybe half a second or
  192.     more), you should put your application to sleep. See
  193.     MUIA_Application_Sleep on how to do this.
  194.  
  195.     SEE ALSO
  196.     MUIA_Application_Sleep, MUIM_Application_InputBuffered
  197. Application.mui/MUIM_Application_InputBuffered
  198.  
  199.     NAME
  200.     MUIM_Application_InputBuffered
  201.  
  202.     SYNOPSIS
  203.     DoMethod(obj,MUIM_Application_InputBuffered,);
  204.  
  205.     FUNCTION
  206.     Imagine your application does some time consuming
  207.     operation, e.g. copying a disk, and you are for
  208.     some reasons unable to react on return ids during
  209.     this period. One solution would be to simply
  210.     put your application to sleep, it will get a
  211.     busy pointer and the user knows whats going on.
  212.  
  213.     However, this will make it impossible for the user
  214.     to resize your applications windows or iconify it,
  215.     he will have to wait until you are done with your
  216.     operation.
  217.  
  218.     MUIM_Application_InputBuffered offers a solution
  219.     for this problem. Using this method, you needn't
  220.     set to sleep your application. Just call it on a
  221.     regular basis and MUI will be able to handle
  222.     all actions concerning the GUI. You do not need
  223.     to pay attention on return values, they remain
  224.     on an internal stack until your next call to
  225.     the non buffered input method.
  226.  
  227.     EXAMPLE
  228.     for (track=0; track<80; track++)
  229.     {
  230.        read_track();
  231.        DoMethod(app,MUIM_Application_InputBuffered);
  232.        write_track();
  233.        DoMethod(app,MUIM_Application_InputBuffered);
  234.     }
  235.  
  236.     SEE ALSO
  237.     MUIM_Application_Input, MUIA_Application_Sleep
  238. Application.mui/MUIM_Application_Load
  239.  
  240.     NAME
  241.     MUIM_Application_Load
  242.  
  243.     SYNOPSIS
  244.     DoMethod(obj,MUIM_Application_Load,STRPTR name);
  245.  
  246.     FUNCTION
  247.     MUIM_Application_Save, MUIM_Application_Load and
  248.     MUIA_ExportID offer an easy way of saving and loading
  249.     a programs configuration.
  250.  
  251.     Each gadget with a non NULL MUIA_ExportID will get
  252.     its contents saved during MUIM_Application_Save and
  253.     restored during MUIM_Application_Load. This makes
  254.     it very easy to design a configuration window
  255.     with "Save", "Use" and "Cancel" buttons to allow
  256.     the user storing the settings. When the application
  257.     starts, you would just have to call MUIM_Application_Load
  258.     and the stored settings will be read and installed.
  259.  
  260.     Not all classes are able to import and export their
  261.     contents. Currently, you may define MUIA_ExportIDs for
  262.  
  263.     String class  - MUIA_String_Contents is ex/imported.
  264.     Radio class   - MUIA_Radio_Active is ex/imported.
  265.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  266.     List class    - MUIA_List_Active is /ex/imported.
  267.     Text class    - MUIA_Text_Contents is ex/imported.
  268.     Slider class  - MUIA_Slider_Level is ex/imported.
  269.     Area class    - MUIA_Selected is ex/imported
  270.                     (e.g. for Checkmark gadgets)
  271.  
  272.     INPUTS
  273.     name - Name of the file you wish to load the settings from.
  274.            Usually you won't need to think of a real name but
  275.            instead use one of the magic cookies
  276.            MUIV_Application_Load_ENV or
  277.            MUIV_Application_Load_ENVARC.
  278.  
  279.     EXAMPLE
  280.     see the sample program "Settings.c"
  281.  
  282.     SEE ALSO
  283.     MUIM_Application_Save, MUIA_ExportID
  284. Application.mui/MUIM_Application_PushMethod
  285.  
  286.     NAME
  287.     MUIM_Application_PushMethod
  288.  
  289.     SYNOPSIS
  290.     DoMethod(obj,MUIM_Application_PushMethod,Object *dest, LONG count, /* ... */);
  291.  
  292.     FUNCTION
  293.     Usually, you may not talk to the MUI system from two
  294.     tasks at the same time. MUIM_Application_PushMethod
  295.     provides some kind of solution for this problem.
  296.  
  297.     This (and only this) method may be called from a
  298.     second task. It takes another method as parameter
  299.     and puts in onto a private stack of the application
  300.     object. The next time MUIM_Application_Input
  301.     is called, the pushed method will be executed
  302.     in the context of the current task.
  303.  
  304.     INPUTS
  305.     dest  - object on which to perform the pushed method.
  306.         count - number of following arguments.
  307.     ...   - the destination method.
  308.  
  309.     EXAMPLE
  310.     /* set a status line from a sub task */
  311.     DoMethod(app,MUIM_Application_PushMethod,
  312.        txstatus,3,MUIM_Set,MUIA_Text_Contents,"reading...");
  313.  
  314.     SEE ALSO
  315.     MUIM_Application_Input
  316. Application.mui/MUIM_Application_ReturnID
  317.  
  318.     NAME
  319.     MUIM_Application_ReturnID
  320.  
  321.     SYNOPSIS
  322.     DoMethod(obj,MUIM_Application_ReturnID,ULONG retid);
  323.  
  324.     FUNCTION
  325.     Tell MUI to return the given id with the next call to 
  326.     MUIM_Application_Input.
  327.  
  328.     Together with the MUI's notification mechanism, this
  329.     method connects your user interface and your program.
  330.     If you e.g. want to be informed if the user presses
  331.     a "Play" button, you would have define an id for
  332.     this action and set up a notification event with
  333.     MUIM_Notify.
  334.  
  335.     You can use any long word as return id, except
  336.     from -255 up to 0. These values are reserved for
  337.     MUI's internal use and for special return values
  338.     like MUIV_Application_ReturnID_Quit.
  339.  
  340.     Note that MUI will put all incoming return ids
  341.     onto a private fifo stack and feed this stack
  342.     to its input methods result code later.
  343.  
  344.     EXAMPLE
  345.  
  346.     /* inform me if a button is pressed (actually released, */
  347.     /* since this is the way amiga buttons are handled)     */
  348.  
  349.     #define ID_PLAYBUTTON 42
  350.  
  351.     ...
  352.  
  353.     DoMethod(buttonobj, MUIM_Notify,
  354.        MUIA_Pressed, FALSE,
  355.        appobj, 2, MUIM_Application_ReturndID, ID_PLAYBUTTON);
  356.  
  357.     ...
  358.  
  359.     while (running)
  360.     {
  361.        switch (DoMethod(appobj,MUIM_Application_Input,&sigs))
  362.        {
  363.           case ID_PLAYBUTTON:
  364.              printf("Ok, lets play a game...");
  365.              break;
  366.        }
  367.     }
  368.  
  369.     SEE ALSO
  370.     MUIM_Application_Input, MUIM_Notify
  371. Application.mui/MUIM_Application_Save
  372.  
  373.     NAME
  374.     MUIM_Application_Save
  375.  
  376.     SYNOPSIS
  377.     DoMethod(obj,MUIM_Application_Save,STRPTR name);
  378.  
  379.     FUNCTION
  380.     MUIM_Application_Save, MUIM_Application_Load and
  381.     MUIA_ExportID offer an easy way of saving and loading
  382.     a programs configuration.
  383.  
  384.     Each gadget with a non NULL MUIA_ExportID will get
  385.     its contents saved during MUIM_Application_Save and
  386.     restored during MUIM_Application_Load. This makes
  387.     it very easy to design a configuration window
  388.     with "Save", "Use" and "Cancel" buttons to allow
  389.     the user storing the settings. When the application
  390.     starts, you would just have to call MUIM_Application_Load 
  391.     and the stored settings will be read and installed.
  392.  
  393.     Not all classes are able to import and export their
  394.     contents. Currently, you may define MUIA_ExportIDs for
  395.  
  396.     String class  - MUIA_String_Contents is ex/imported.
  397.     Radio class   - MUIA_Radio_Active is ex/imported.
  398.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  399.     List class    - MUIA_List_Active is /ex/imported.
  400.     Text class    - MUIA_Text_Contents is ex/imported.
  401.     Slider class  - MUIA_Slider_Level is ex/imported.
  402.     Area class    - MUIA_Selected is ex/imported
  403.                     (e.g. for Checkmark gadgets).
  404.  
  405.     INPUTS
  406.     name - Name of the file you wish to save the settings to.
  407.            Usually you won't need to think of a real name but
  408.            instead use one of the magic cookies
  409.            MUIV_Application_Save_ENV or
  410.            MUIV_Application_Save_ENVARC.
  411.            This will save your application's settings somewhere
  412.            in env:mui/ or envarc:mui/, you needn't worry about
  413.            it.
  414.  
  415.     EXAMPLE
  416.     see the sample program "Settings.c"
  417.  
  418.     SEE ALSO
  419.     MUIM_Application_Load, MUIA_ExportID
  420. Application.mui/MUIM_Application_SetMenuCheck
  421.  
  422.     NAME
  423.     MUIM_Application_SetMenuCheck
  424.  
  425.     SYNOPSIS
  426.     DoMethod(obj,MUIM_Application_SetMenuCheck,ULONG MenuID, LONG stat);
  427.  
  428.     FUNCTION
  429.     Set or clear the checkmark of a menu item.
  430.     The application will ask its sub windows for menu items
  431.     with the given id and set/clear all found
  432.     entries.
  433.  
  434.     INPUTS
  435.     MenuID - the value you wrote into the
  436.                  UserData field of struct NewMenu.
  437.  
  438.     set    - TRUE to set checkmark, FALSE to clear
  439.  
  440.     SEE ALSO
  441.     MUIM_Application_GetMenuCheck, MUIA_Application_Menu,
  442. Application.mui/MUIM_Application_SetMenuState
  443.  
  444.     NAME
  445.     MUIM_Application_SetMenuState
  446.  
  447.     SYNOPSIS
  448.     DoMethod(obj,MUIM_Application_SetMenuState,ULONG MenuID, LONG stat);
  449.  
  450.     FUNCTION
  451.     Enable or disable a menu item.
  452.     The application will ask its sub windows for menu items
  453.     with the given id and enable/disable all found
  454.     entries.
  455.  
  456.     INPUTS
  457.     MenuID - the value you wrote into the
  458.                  UserData field of struct NewMenu.
  459.  
  460.     set    - TRUE to enable item, FALSE to disable.
  461.  
  462.     SEE ALSO
  463.     MUIM_Application_GetMenuState, MUIA_Application_Menu,
  464. Application.mui/MUIM_Application_ShowHelp
  465.  
  466.     NAME
  467.     MUIM_Application_ShowHelp
  468.  
  469.     SYNOPSIS
  470.     DoMethod(obj,MUIM_Application_ShowHelp,Object *window, char *name, char *node, LONG line);
  471.  
  472.     FUNCTION
  473.     Show an AmigaGuide help file. The application will be
  474.     put to sleep until the file is displayed.
  475.  
  476.     Usually, you don't need to call this method directly.
  477.     MUI comes with a sophisticated online help system,
  478.     you just need to supply your gadgets with help nodes
  479.     and everything will be handled automatically.
  480.  
  481.     INPUTS
  482.     window - (Object *) - Help will appear on this windows
  483.                           screen. May be NULL.
  484.     name   - (char *)   - name of the help file
  485.     node   - (char *)   - name of a node in this help file
  486.     line   - (char *)   - line number
  487.  
  488.     SEE ALSO
  489.     MUIA_HelpFile, MUIA_HelpNode, MUIA_HelpLine
  490. Application.mui/MUIA_Application_Active
  491.  
  492.     NAME
  493.     MUIA_Application_Active -- [ISG], BOOL
  494.  
  495.     FUNCTION
  496.     This attribute reflects the state that the user adjusted
  497.     with commodities Exchange. MUI itself doesn't pay any
  498.     attention to it, this is up to you.
  499.  
  500.     SEE ALSO
  501.     MUIA_Application_Broker
  502. Application.mui/MUIA_Application_Author
  503.  
  504.     NAME
  505.     MUIA_Application_Author -- [I.G], STRPTR
  506.  
  507.     FUNCTION
  508.     Name of the applications author.
  509.  
  510.     EXAMPLE
  511.     see MUIA_Application_Title
  512.  
  513.     SEE ALSO
  514.     MUIA_Application_Title, MUIA_Application_Copyright,
  515.     MUIA_Application_Version, MUIA_Application_Description,
  516.     MUIA_Application_Base
  517. Application.mui/MUIA_Application_Base
  518.  
  519.     NAME
  520.     MUIA_Application_Base -- [I.G], STRPTR
  521.  
  522.     FUNCTION
  523.     The basename for an application. This name is used
  524.     for the builtin ARexx port and for some internal
  525.     file management.
  526.  
  527.     A basename must neither contain spaces nor any
  528.     special characters such as ":/()#?*...".
  529.  
  530.     When your program is a single task application
  531.     (i.e. MUIA_Application_SingleTask is TRUE), the
  532.     base name will be used without further modification.
  533.  
  534.     Otherwise, it gets a ".1", ".2", etc. appended,
  535.     depending on how many applications are already
  536.     running. If you need to know the name of your
  537.     ARexx port, you can query the base name attribute
  538.     after the application is created.
  539.  
  540.     EXAMPLE
  541.     see MUIA_Application_Title
  542.  
  543.     SEE ALSO
  544.     MUIA_Application_Title, MUIA_Application_Version,
  545.     MUIA_Application_Author, MUIA_Application_Copyright,
  546.     MUIA_Application_Description
  547. Application.mui/MUIA_Application_Broker
  548.  
  549.     NAME
  550.     MUIA_Application_Broker -- [..G], Broker *
  551.  
  552.     FUNCTION
  553.     If you need to attach some additional commodities objects
  554.     to your application (e.g. because you need lots of hotkeys),
  555.     you can obtain a pointer to the applications Broker structure
  556.     and add some commodities objects.
  557.     
  558.     MUI will free the complete broker when the application is
  559.     disposed, no need for you to free your objects yourself.
  560.  
  561.     To receive input from your objects, you will also need to
  562.     install a MUIA_Application_BrokerHook.
  563.  
  564.     SEE ALSO
  565.     MUIA_Application_BrokerHook
  566. Application.mui/MUIA_Application_BrokerHook
  567.  
  568.     NAME
  569.     MUIA_Application_BrokerHook -- [ISG], struct Hook *
  570.  
  571.     FUNCTION
  572.     You specify a pointer to hook structure. The function
  573.     will be called whenever a commodities message arrives
  574.     (between MUI's GetMsg() and ReplyMsg()).
  575.  
  576.     You receive a pointer to the application object
  577.     as object in a2 and a pointer to commodities
  578.     CxMsg message in a1.
  579.  
  580.     SEE ALSO
  581.     MUIA_Application_Broker
  582. Application.mui/MUIA_Application_BrokerPort
  583.  
  584.     NAME
  585.     MUIA_Application_BrokerPort -- [..G], struct MsgPort *
  586.  
  587.     FUNCTION
  588.     Get a pointer to the applications commodities message port.
  589.     If you want to add own Hotkeys to your application, you
  590.     need a message port. Instead of creating your own, you
  591.     should better use this one.
  592.  
  593.     SEE ALSO
  594.     MUIA_Application_BrokerHook
  595. Application.mui/MUIA_Application_BrokerPri
  596.  
  597.     NAME
  598.     MUIA_Application_BrokerPri -- [I.G], LONG
  599.  
  600.     FUNCTION
  601.     Adjust the priority of an applications broker.
  602.  
  603.     SEE ALSO
  604.     MUIA_Application_BrokerHook
  605. Application.mui/MUIA_Application_Commands
  606.  
  607.     NAME
  608.     MUIA_Application_Commands -- [ISG], struct MUI_Command *
  609.  
  610.     FUNCTION
  611.     This attribute allows an application to include 
  612.     its own set of ARexx commands. You specify a
  613.     pointer to an array of MUI_Command structures,
  614.     which look like this:
  615.  
  616.     struct MUI_Command
  617.     {
  618.        char        *mc_Name;
  619.        char        *mc_Template;
  620.        LONG         mc_Parameters;
  621.        struct Hook *mc_Hook;
  622.        LONG         mc_Reserved[5];
  623.     };
  624.  
  625.     mc_Name       contains the name of your command.
  626.                   Commands are not case sensitive.
  627.  
  628.     mc_Template   is an argument template that follows
  629.                   the same rules as dos.library/ReadArgs().
  630.                   It may be NULL, in which case your command
  631.                   doesn't need any parameters.
  632.  
  633.     mc_Parameters is the number of parameters specified
  634.                   in the template array.
  635.  
  636.     mc_Hook       is a pointer to the callback hook defining
  637.                   the function to be called.
  638.  
  639.     You may specify any number of MUI_Command structures,
  640.     but you must terminate your array with a NULL field.
  641.  
  642.     When a command shows up an applications ARexx port,
  643.     MUI parses the arguments according to the given
  644.     template and calls the hook with the application
  645.     object as hook object in a2 and a pointer to
  646.     an array of longwords containing the parameters
  647.     in a1.
  648.  
  649.     The result code of your hook will be replied to
  650.     ARexx as rc.
  651.  
  652.     If you have some simple ARexx commands that just
  653.     emulate some user action (e.g. clicking a button),
  654.     you can use the magic cookie MC_TEMPLATE_ID for 
  655.     mc_Template and a return id value for mc_Parameters. 
  656.     In this case, MUI will do no argument parsing and 
  657.     instead simply return the specified id value on the 
  658.     next call to MUIM_Application_Input.
  659.  
  660.     For more sophisticated possibilities in ARexx
  661.     callback hooks, please refer to
  662.     MUIA_Application_RexxMsg and MUIA_Application_RexxString.
  663.  
  664.     EXAMPLE
  665.     static struct MUI_Command commands[] =
  666.     {
  667.        { "rescan", MC_TEMPLATE_ID, ID_RESCAN, NULL     },
  668.        { "select", "PATTERN/A"   , 1        , &selhook },
  669.        { NULL    , NULL          , NULL     , NULL     }
  670.     };
  671.  
  672.     SEE ALSO
  673.     MUIA_Application_RexxMsg, MUIA_Application_RexxString
  674. Application.mui/MUIA_Application_Copyright
  675.  
  676.     NAME
  677.     MUIA_Application_Copyright -- [I.G], STRPTR
  678.  
  679.     FUNCTION
  680.     A copyright string, containing the year and the
  681.     company.
  682.  
  683.     EXAMPLE
  684.     see MUIA_Application_Title
  685.  
  686.     SEE ALSO
  687.     MUIA_Application_Title, MUIA_Application_Version,
  688.     MUIA_Application_Author, MUIA_Application_Description,
  689.     MUIA_Application_Base
  690. Application.mui/MUIA_Application_Description
  691.  
  692.     NAME
  693.     MUIA_Application_Description -- [I.G], STRPTR
  694.  
  695.     FUNCTION
  696.     Short description, about 40 characters.
  697.     Shown e.g. in commodities exchange.
  698.  
  699.     EXAMPLE
  700.     see MUIA_Application_Title
  701.  
  702.     SEE ALSO
  703.     MUIA_Application_Title, MUIA_Application_Version,
  704.     MUIA_Application_Author, MUIA_Application_Copyright,
  705.     MUIA_Application_Base
  706. Application.mui/MUIA_Application_DiskObject
  707.  
  708.     NAME
  709.     MUIA_Application_DiskObject -- [ISG], struct DiskObject *
  710.  
  711.     FUNCTION
  712.     Pointer to a struct DiskObject, e.g. obtained
  713.     from GetDiskObject(). If present, MUI will use
  714.     this object for the AppIcon when your application
  715.     gets iconified.
  716.  
  717.     Otherwise MUI will try to locate "env:sys/dev_mui.info"
  718.     and, if not present, fall back to a default icon.
  719.  
  720.     EXAMPLE
  721.     ...
  722.     MUIA_Application_DiskObject, 
  723.        dobj = GetDiskObject("PROGDIR:MyApp"),
  724.     ...
  725.  
  726.     /* note that you have to free dobj yourself! */
  727.  
  728.    SEE ALSO
  729.     MUIA_Application_Iconified
  730. Application.mui/MUIA_Application_DoubleStart
  731.  
  732.     NAME
  733.     MUIA_Application_DoubleStart -- [..G], BOOL
  734.  
  735.     FUNCTION
  736.     This attribute is set automatically when the user
  737.     tries to start a MUIA_SingleTask application twice.
  738.     You can react on this and take appropriate actions,
  739.     e.g. pop up a requester or quit yourself.
  740.  
  741.     SEE ALSO
  742.     MUIA_Application_SingleTask
  743. Application.mui/MUIA_Application_DropObject
  744.  
  745.     NAME
  746.     MUIA_Application_DropObject -- [IS.], Object *
  747.  
  748.     FUNCTION
  749.     If your application is iconified and the user drops
  750.     icons onto the AppIcon, the object specified here will 
  751.     receive the AppMessage.
  752.  
  753.     SEE ALSO
  754.     MUIA_Window_AppWindow, MUIM_CallHook
  755. Application.mui/MUIA_Application_Iconified
  756.  
  757.     NAME
  758.     MUIA_Application_Iconified -- [.SG], BOOL
  759.  
  760.     FUNCTION
  761.     Setting this attribute to TRUE causes the application
  762.     to become iconified. Every open window will be closed
  763.     and a (configurable) AppIcon will appear on the workbench.
  764.  
  765.     Same thing happens when the user hits the iconify gadget
  766.     in the window border or uses commodities Exchange to
  767.     hide your applications interface.
  768.  
  769.     There is no way for you to prevent your application from
  770.     being iconified. However, you can react on the iconification
  771.     by listening to the MUIA_Application_Iconified attribute
  772.     with notification. This allows you to free some resources
  773.     you don't need in iconified state.
  774.  
  775.     When an application is iconified and you try to open a
  776.     window, the window won't open immediately. Instead MUI
  777.     remembers this action and opens the window once the
  778.     application is uniconified again.
  779.  
  780.     EXAMPLE
  781.  
  782.     /* inform the main input loop of iconification events */
  783.  
  784.     #define ID_HIDE 42
  785.     #define ID_SHOW 24
  786.  
  787.     DoMethod(app,MUIM_Notify,
  788.        MUIA_Application_Iconified, TRUE,
  789.        app, 2, MUIM_Application_ReturnID, ID_HIDE);
  790.  
  791.     DoMethod(app,MUIM_Notify,
  792.        MUIA_Application_Iconified, FALSE,
  793.        app, 2, MUIM_Application_ReturnID, ID_SHOW);
  794.  
  795.     SEE ALSO
  796.     MUIA_Application_DiskObject
  797. Application.mui/MUIA_Application_Menu
  798.  
  799.     NAME
  800.     MUIA_Application_Menu -- [I.G], struct NewMenu *
  801.  
  802.     FUNCTION
  803.     You can define a global menu for all the windows
  804.     in your application. Whenever a new window is
  805.     opened, it gets its menu from this place
  806.     as long as the window doesn't define its own menu.
  807.  
  808.     The attribute points to a conventional NewMenu
  809.     structure array from gadtools. You might want to
  810.     fill the UserData field of a NewMenu entry width
  811.     an id value. This id will be returned through
  812.     the applications input method when the
  813.     corresponding menu item is selected.
  814.  
  815.     Selecting a menu item might also trigger
  816.     MUIA_Application_MenuAction and MUIA_Application_MenuHelp.
  817.  
  818.     EXAMPLE
  819.  
  820.     #define ID_ABOUT 1
  821.     #define ID_QUIT  MUIV_Application_ReturnID_Quit
  822.  
  823.     struct NewMenu NewMenu[] =
  824.     {
  825.        { NM_TITLE, "Project"  , 0 ,0,0,(APTR)0        },
  826.        { NM_ITEM , "About..." ,"?",0,0,(APTR)ID_ABOUT },
  827.        { NM_ITEM , NM_BARLABEL, 0 ,0,0,(APTR)0        },
  828.        { NM_ITEM , "Quit"     ,"Q",0,0,(APTR)ID_QUIT  },
  829.        { NM_END  , NULL       , 0 ,0,0,(APTR)0        },
  830.     };
  831.  
  832.     ApplicationObject,
  833.        ...,
  834.        MUIA_Application_Menu, NewMenu,
  835.        ...
  836.  
  837.     SEE ALSO
  838.     MUIA_Application_Input, MUIA_Window_Menu,
  839.     MUIA_Application_MenuAction, MUIA_Application_MenuHelp
  840. Application.mui/MUIA_Application_MenuAction
  841.  
  842.     NAME
  843.     MUIA_Application_MenuAction -- [..G], ULONG
  844.  
  845.     FUNCTION
  846.     Whenever a menu item is selected, this attribute will be
  847.     set to the corresponding UserData field of the gadtools
  848.     NewMenu structure. This allows reacting on menu items
  849.     via broadcasting.
  850.  
  851.     SEE ALSO
  852.     MUIA_Application_Menu, MUIA_Application_MenuAction
  853. Application.mui/MUIA_Application_MenuHelp
  854.  
  855.     NAME
  856.     MUIA_Application_MenuHelp -- [..G], ULONG
  857.  
  858.     FUNCTION
  859.     Whenever a menu item is selected with the help key, this
  860.     attribute will be set to the corresponding UserData field
  861.     of the gadtools NewMenu structure. Together with
  862.     MUIM_Application_ShowHelp this allows creation of
  863.     menu help texts.
  864.  
  865.     SEE ALSO
  866.     MUIA_Application_Menu, MUIA_Application_ShowHelp
  867. Application.mui/MUIA_Application_RexxHook
  868.  
  869.     NAME
  870.     MUIA_Application_RexxHook -- [ISG], struct Hook *
  871.  
  872.     FUNCTION
  873.     When specified, MUI calls this hook whenever a rexx message 
  874.     arrives and MUI can't map it to a builtin or a programmer
  875.     specified command. The hook will be called with a pointer 
  876.     to itself in A0, a pointer to the application object in A2 
  877.     and a pointer to a struct RexxMsg in A1.
  878.  
  879.     The return code from the hook is used as result code
  880.     when replying the message, the secondary result can
  881.     be set with MUIA_Application_RexxString.
  882.  
  883.     SEE ALSO
  884.     MUIA_Application_Commands
  885. Application.mui/MUIA_Application_RexxMsg
  886.  
  887.     NAME
  888.     MUIA_Application_RexxMsg -- [..G], struct RxMsg *
  889.  
  890.     FUNCTION
  891.     Within an ARexx callback hook, you can obtain
  892.     a pointer to the RexxMsg that came with the
  893.     command. This allows you to use some ARexx
  894.     support functions coming with amiga.lib
  895.  
  896.     SEE ALSO
  897.     MUIA_Application_Commands, MUIA_Application_RexxString
  898. Application.mui/MUIA_Application_RexxString
  899.  
  900.     NAME
  901.     MUIA_Application_RexxString -- [.S.], STRPTR
  902.  
  903.     FUNCTION
  904.     ARexx allows returning a string as result of a
  905.     function call. This attribute allows setting the
  906.     result string within an ARexx callback hook.
  907.  
  908.     The string is temporarily copied.
  909.  
  910.     SEE ALSO
  911.     MUIA_Application_Commands, MUIA_Application_RexxMsg
  912. Application.mui/MUIA_Application_SingleTask
  913.  
  914.     NAME
  915.     MUIA_Application_SingleTask -- [I..], BOOL
  916.  
  917.     FUNCTION
  918.     Boolean value to indicate whether or not your application
  919.     is a single task program. When set to TRUE, MUI will
  920.     refuse to create more than one application object.
  921.  
  922.     In this case, the already running application gets its
  923.     MUIA_DoubleStart attribute set to TRUE. You can listen
  924.     to this and take appropriate actions, e.g. pop up
  925.     a requester.
  926.  
  927.     Examples for single task applications are the system
  928.     preferences program. It doesn't make sense for them
  929.     to run more than once.
  930.  
  931.     SEE ALSO
  932.     MUIA_Application_DoubleStart
  933. Application.mui/MUIA_Application_Sleep
  934.  
  935.     NAME
  936.     MUIA_Application_Sleep -- [.S.], BOOL
  937.  
  938.     FUNCTION
  939.     This attribute can be used to put a whole application
  940.     to sleep. All open windows get disabled and a busy
  941.     pointer appears.
  942.  
  943.     This attribute contains a nesting count, if you tell
  944.     your application to sleep twice, you will have to tell 
  945.     it to wake up twice too.
  946.  
  947.     If you need to do some time consuming actions, you
  948.     always should set this attribute to inform the user
  949.     that you are currently unable to handle input.
  950.  
  951.     A sleeping application's windows cannot be resized.
  952.  
  953.     EXAMPLES
  954.     set(app,MUIA_Application_Sleep,TRUE ); // go to bed
  955.     calc_fractals();
  956.     set(app,MUIA_Application_Sleep,FALSE); // wake up
  957.  
  958.     SEE ALSO
  959.     MUIA_Window_Sleep, MUIM_Application_InputBuffered
  960. Application.mui/MUIA_Application_Title
  961.  
  962.     NAME
  963.     MUIA_Application_Title -- [I.G], STRPTR
  964.  
  965.     FUNCTION
  966.     This tag defines the title of an application.
  967.     The title is e.g. shown in Commodities Exchange
  968.     or in the MUI preferences program.
  969.  
  970.     An application title shall not contain any version
  971.     information, just the pure title. Also, special
  972.     characters such as ":/()#?*..." are not allowed.
  973.  
  974.     You should use a quiet long and unique name for
  975.     your applications. Naming it "Viewer" or "Browser"
  976.     is not a wise choice.
  977.  
  978.     The length of the name must not exceed 30 characters!
  979.  
  980.     EXAMPLE
  981.     ApplicationObject,
  982.        MUIA_Application_Title      , "WbMan",
  983.        MUIA_Application_Version    , "$VER: WbMan 0.24 (19.7.93)",
  984.        MUIA_Application_Copyright  , "© 1993 by Klaus Melchior",
  985.        MUIA_Application_Author     , "Klaus Melchior",
  986.        MUIA_Application_Description, "Manages the WBStartup.",
  987.        MUIA_Application_Base       , "WBMAN",
  988.        ...
  989.  
  990.     SEE ALSO
  991.     MUIA_Application_Version, MUIA_Application_Copyright,
  992.     MUIA_Application_Author, MUIA_Application_Description,
  993.     MUIA_Application_Base
  994. Application.mui/MUIA_Application_Version
  995.  
  996.     NAME
  997.     MUIA_Application_Version -- [I.G], STRPTR
  998.  
  999.     FUNCTION
  1000.     Define a version string for an application.
  1001.     This string shall follow standard version string
  1002.     convetions but must *not* contain a leading "\0".
  1003.  
  1004.     EXAMPLE
  1005.     see MUIA_Application_Title
  1006.  
  1007.     SEE ALSO
  1008.     MUIA_Application_Title, MUIA_Application_Copyright,
  1009.     MUIA_Application_Author, MUIA_Application_Description,
  1010.     MUIA_Application_Base
  1011. Application.mui/MUIA_Application_Window
  1012.  
  1013.     NAME
  1014.     MUIA_Application_Window -- [I..], Object *
  1015.  
  1016.     FUNCTION
  1017.     A pointer to a MUI object of Window class. An
  1018.     application may have any number of sub windows,
  1019.     each of them being a child of the application.
  1020.  
  1021.     When the application receives some kind of user
  1022.     input through its IDCMP, it diverts the message
  1023.     down to its children, as long as they are opened.
  1024.  
  1025.     Things like iconification or preferences changes
  1026.     cause the application object to temporarily close
  1027.     every open window (and reopen it later). Your
  1028.     main program normally doesn't need to deal with
  1029.     these things.
  1030.  
  1031.     As with the children of group class, it's common
  1032.     to use a call to MUI_NewObject() as value for
  1033.     this attribute. No error checking needs to be
  1034.     done, the application object handles every
  1035.     failure automatically.
  1036.  
  1037.     When you dispose your application, its sub windows
  1038.     will also get deleted. Thus, the only thing to do
  1039.     to remove your application is a
  1040.  
  1041.     MUI_DisposeObject(ApplicationObject);
  1042.  
  1043.     Every window, every gadget, every memory will be
  1044.     freed by this single call.
  1045.  
  1046.     EXAMPLE
  1047.     Please refer to one of the example programs.
  1048.  
  1049.     SEE ALSO
  1050.